<%@ include file="/view/template/header.jsp"%>	
	<div id="content">
    	<%@ include file="/view/ehr/ehr_common.jsp"%>
    	<script>
			$(function() {
				$("#tabs").tabs();
			});

		</script>
        <div class="right-content">
        	<s:if test='replyMessage.message!="empty"'>
					<h3><s:property value="replyMessage.message"/></h3>
			</s:if>
			<s:else>
				<div id="tabs">
					<ul>
						<%int i=0; %>
						<h1><s:text name="label.viewPatientDetails.past_admissions"/></h1>
						<s:if test="oldAdmissionRecords.size > 0">
							<s:iterator value="oldAdmissionRecords" >
								<%i++; %>
								<li><a href="#tabs_<%=i%>"><% out.println(i);%></a>
								</li>
							</s:iterator>
						</s:if>
					</ul>
					<%int k=0; %>
						<s:if test="oldAdmissionRecords.size > 0">
							<s:iterator value="oldAdmissionRecords" var="x">
								<%k++; %>
								<div id="tabs_<%=k%>">
									<div class="box">
										<h1><s:text name="label.admit.admission_information"/>:<s:property value="%{admission_date}"/></h1>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.patient_id"></s:label></span>
											<s:textfield value="%{patient_id}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.admission_date"></s:label></span>
											<s:textfield value="%{admission_date}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.admitting_officer"></s:label></span>
											<s:textfield value="%{admiting_officer}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.admitted_bed"></s:label></span>
											<s:textfield value="%{#x.bed}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.admitted_ward"></s:label></span>
											<s:textfield value="%{#x.ward}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.dicharged_bed"></s:label></span>
											<s:textfield value="%{bht.current_bed}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.discharged_ward"></s:label></span>
											<s:textfield value="%{bht.current_ward}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.bht.consultant_id"></s:label></span>
											<s:textfield value="%{bht.consultant_id}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.admit_reason"></s:label></span>
											<s:textarea value="%{admit_reason}" readonly="true" cssClass="textareaStyle"/>
										</div>
										<div class="clear"></div>
										<h1><s:text name="label.admit.guardian_information"/></h1>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.guardian.prefix"></s:label></span>
											<s:textfield value="%{guardian.prefix}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.guardian.given_name"></s:label></span>
											<s:textfield value="%{guardian.given_name}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.guardian.furthur_names"></s:label></span>
											<s:textfield value="%{guardian.furthur_names}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.guardian.surname"></s:label></span>
											<s:textfield value="%{guardian.surname}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.guardian.nic_no"></s:label></span>
											<s:textfield value="%{guardian.nic_no}" readonly="true"/>
										</div>
										<s:if test="guardian.addresses.size > 0">
											<s:iterator value="guardian.addresses">
												<div class="con-part">
													<span><s:label key="label.viewPatientDetails.guardian.addresses.house_number"></s:label></span>
													<s:textfield value="%{house_number}" readonly="true"/>
												</div>
												<div class="con-part">
													<span><s:label key="label.viewPatientDetails.guardian.addresses.street"></s:label></span>
													<s:textfield value="%{street}" readonly="true"/>
												</div>
												<div class="con-part">
													<span><s:label key="label.viewPatientDetails.guardian.addresses.city_1"></s:label></span>
													<s:textfield value="%{city_1}" readonly="true"/>
												</div>
												<div class="con-part">
													<span><s:label key="label.viewPatientDetails.guardian.addresses.city_2"></s:label></span>
													<s:textfield value="%{city_2}" readonly="true"/>
												</div>
												<div class="con-part">
													<span><s:label key="label.viewPatientDetails.guardian.addresses.country"></s:label></span>
													<s:textfield value="%{country}" readonly="true"/>
												</div>
											</s:iterator>
										</s:if>
										<s:if test="guardian.telephoneNumbers.size > 0">
											<div class="con-part">
												<span><s:label key="label.viewPatientDetails.guardian.telephoneNumbers"></s:label></span>
												<s:iterator value="guardian.telephoneNumbers">
													<s:textfield value="%{guardian.telephoneNumbers}" readonly="true"/>
												</s:iterator>
											</div>
										</s:if>
										<s:if test="guardian.email.size > 0">
											<div class="con-part">
												<span><s:label key="label.viewPatientDetails.guardian.email"></s:label></span>
												<s:iterator value="guardian.email">
													<s:textfield value="%{guardian.email}" readonly="true"/>
												</s:iterator>
											</div>
										</s:if>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.guardian.guardian_relationship"></s:label></span>
											<s:textfield value="%{guardian.guardian_relationship}" readonly="true"/>
										</div>
										<s:if test="medicalRecords.size > 0">
											<div class="clear"></div>
											<h1><s:text name="label.medicalRecords.observation_information"/></h1>
											<table border="1px" bordercolor="#0000FF">
												<tr>
													<td><span><s:label key="label.viewPatientDetails.medical_records.observation"></s:label></span></td>
													<td><span><s:label key="label.viewPatientDetails.medical_records.observerId"></s:label></span></td>
													<td><span><s:label key="label.viewPatientDetails.medical_records.observationdate"></s:label></span></td>
												</tr>
												<s:iterator value="medicalRecords">
													<tr>
														<td><s:textarea value="%{observation}" readonly="true" cssClass="textareaStyle"/></td>
														<td><s:textfield value="%{observerId}" readonly="true"/></td>
														<td><s:textfield value="%{observationdate}" readonly="true"/></td>
													</tr>
												</s:iterator>
											</table>
											<div class="clear"></div>
											<h1><s:text name="label.medicalRecords.diagosis_information"/></h1>
											<table border="1px" bordercolor="#0000FF">
												<tr>
													<td><span><s:label key="label.viewPatientDetails.medical_records.diagosis"></s:label></span></td>
													<td><span><s:label key="label.viewPatientDetails.medical_records.diagnosingClinicianId"></s:label></span></td>
													<td><span><s:label key="label.viewPatientDetails.medical_records.diagnosingDate"></s:label></span></td>
												</tr>
												<s:iterator value="medicalRecords">
													<tr>
														<td><s:textarea value="%{diagosis}" readonly="true" cssClass="textareaStyle"/></td>
														<td><s:textfield value="%{diagnosingClinicianId}" readonly="true"/></td>
														<td><s:textfield value="%{diagnosingDate}" readonly="true"/></td>
													</tr>
												</s:iterator>
											</table>
										</s:if>
										<div class="clear"></div>
										<h1><s:text name="label.viewPatientDetails.discharge"/></h1>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.discharge_date"></s:label></span>
											<s:textfield value="%{discharge_date}" readonly="true"/>
										</div>
										<div class="con-part">
											<span><s:label key="label.viewPatientDetails.discharge_comments"></s:label></span>
											<s:textarea value="%{comments}" readonly="true" cssClass="textareaStyle"/>
										</div>
									</div>
								</div>
							</s:iterator>
						</s:if>
					</div>
				</s:else>
			</div>
	</div>
<%@ include file="/view/template/footer.jsp"%>
